//
//  WelcomeViewController.swift
//  WBTest
//
//  Created by 张海峰 on 2017/7/27.
//  Copyright © 2017年 张海峰. All rights reserved.
//

import UIKit
import SDWebImage
class WelcomeViewController: UIViewController {

    @IBOutlet weak var iconImageView: UIImageView!
    @IBOutlet weak var iconViewBottomCons: NSLayoutConstraint!
    override func viewDidLoad() {
        super.viewDidLoad()
      //http://img3.imgtn.bdimg.com/it/u=951120017,198117664&fm=26&gp=0.jpg
        let urlStr = "http://v1.qzone.cc/avatar/201409/24/19/58/5422b1ff86ed0232.jpg%21200x200.jpg"
        iconViewBottomCons.constant = 300
        let iconUrl = URL.init(string: urlStr)
        iconImageView.setImageWith(iconUrl!, placeholderImage: UIImage.init(named: "头像"))
        /**
         usingSpringWithDamping:阻力系数，阻力系数越大，弹动的效果越不明显 0～1
         initialSpringVelocity: 初始化速度
         */
        UIView.animate(withDuration: 1.5, delay: 0, usingSpringWithDamping: 0.5, initialSpringVelocity: 5.0, options: [], animations: {
            self.view.layoutIfNeeded()
        }) { (_) in
              UIApplication.shared.keyWindow?.rootViewController =  UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController()
        }
    }
}
